﻿using Orchard.DisplayManagement;
using Orchard.Environment.Extensions;
using Orchard.Forms.Services;
using Orchard.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace F2B.Orchard.Schedule.Providers.Layouts
{
    [OrchardFeature("F2B.Orchard.CalendarLayout")]
    public class UpcomingLayoutForms : IFormProvider
    {
        protected dynamic Shape { get; set; }
        public Localizer T { get; set; }

        public UpcomingLayoutForms(
            IShapeFactory shapeFactory)
        {
            Shape = shapeFactory;
            T = NullLocalizer.Instance;
        }

        public void Describe(DescribeContext context)
        {
            Func<IShapeFactory, object> form =
                shape =>
                {

                    var f = Shape.Form(
                        Id: "UpcomingEventsLayout"                      
                    );
                    return f;
                };

            context.Form("UpcomingEventsLayout", form);

        }
    }
}